package com.zhongfl.crm.lixiao.mapper;

import com.zhongfl.crm.enums.boss.OrderAttachmentType;
import com.zhongfl.crm.model.boss.OrderAttachment;
import com.zhongfl.crm.model.boss.OrderAttachmentQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderAttachmentMapper {
    int deleteByPrimaryKey(Integer id);

    int insertSelective(OrderAttachment record);

    OrderAttachment selectByPrimaryKey(Integer id);

    List<OrderAttachment> selectByQuery(OrderAttachmentQuery queryInfo);

    int updateByPrimaryKeySelective(OrderAttachment record);

    int updateByPrimaryKey(OrderAttachment record);

    void deleteByFilePath(@Param("filePath") String filePath, @Param("deleteBy") String deleteBy);

    /**
     * 通过订单号和类型查询
     * @param orderNo 订单号
     * @param key 类型
     * @return 附件列表信息
     */
    List<OrderAttachment> selectByOrderNoAndKey(@Param("orderNo") String orderNo, @Param("key") OrderAttachmentType key);

    /**
     * 通过workOrderNo和类型查询
     * @param workOrderNo workOrderNo
     * @param key 类型
     * @return 附件列表信息
     */
    List<OrderAttachment> selectByWorkOrderNoAndKey(@Param("workOrderNo") String workOrderNo, @Param("key") OrderAttachmentType key);

    /**
     * 通过workOrderNo和key删除
     * @param workOrderNo workOrderNo
     * @param key key
     */
    void deleteByWorkOrderNoAndKey(@Param("workOrderNo") String workOrderNo, @Param("key") OrderAttachmentType key, @Param("staffName") String staffName);
}